<template>
	<view>
		<view class="tn-main-gradient-indigo--reverse kaiti admin-title">实用工具</view>
		<view class="link">
			<tn-list-cell
				v-for="item in toolList"
				:key="item.id"
				:arrow="true"
				@click="openPge(item.herf)"
				:arrowRight="true">
				<view class="link-item">
					<view class="link-item-img">
						<tn-avatar-group :lists="[{src: item.img}]" size="sm"></tn-avatar-group>
					</view>
					<view class="link-item-text">{{item.name }}</view>
					<view class="link-item-doc">{{item.doc }}</view>
				</view>
			</tn-list-cell>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				toolList:[]
			};
		},
		methods:{
			getTool(){
				this.$api.getTool().then(res => {
					console.log(res)
					if(res.code == 200){
						this.toolList = res.data
					}
				})
			},
			openPge(url){
				uni.navigateTo({
				    url:`/pages/webView/index?herf=${url}`
				})
			}
		},
		onShow() {
			this.getTool()
		}
	}
</script>

<style lang="scss">
.admin-title{
	text-align: center;
	font-size: 38rpx;
	padding: 20rpx 0;
}
.link{
	padding: 40rpx;
	&-item{
		display: flex;
		justify-content: flex-start;
		align-items: center;
		&-img{
			margin-right: 18rpx;
		}
		&-text{
			color: #5F4FD9;
		}
		&-doc{
			margin-left: 20rpx;
			color:#C6D1D8;
		}
	}
}
</style>
